package gof_001_创建型_Create.gof_001_单例_Singleton.gof_003_Lazy;

//并发测试
public class LayMainConcurrent {
    public static void main(String[] args) {

        //Thread-7	 - gof_01_Create.gof_001_Singleton.gof_003_Lazy.Student@7837a5b7
        //Thread-11	 - gof_01_Create.gof_001_Singleton.gof_003_Lazy.Student@22ff7883
        //Thread-0	 - gof_01_Create.gof_001_Singleton.gof_003_Lazy.Student@384e8869

        for (int i = 0; i < 1000; i++) {
            Thread t = new Thread(() -> {
                Student student = Student.getInstance();
                System.out.println(Thread.currentThread().getName() + "\t - " + student);
            });
            t.start();
        }
    }
}
